Skip to content

Redundant class cleanup #86

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jul 25, 2025
Merged

Conversation

softwareengineerprogrammer
Copy link
Owner

@softwareengineerprogrammer softwareengineerprogrammer commented Jul 24, 2025

Description

  1. Remove redundant code from SBTEconomics and SUTRAEconomics that already exists in Economics parent class
  2. Adds support for peaking boiler cost to SUTRAEconomics because it was incidentally trivial to implement in the course of refactoring. (Hardcoded peaking boiler cost in SUTRA was overlooked by Peaking Boiler Cost per kW; Increase allowed fractures; Honor Capital Cost for Power Plant; Client caching fix; Cape-4 laterals & res. vol.; Doublets parameter [v3.9.28] NREL/GEOPHIRES-X#394, which resolved Feature Request: DH LCOH with peaking boiler cost = 0 NREL/GEOPHIRES-X#392.)

Testing & Verification

  1. Existing tests pass as-is - no change to behavior
  2. Note that SUTRAEconomics retains a few seemingly-redundant parameters from parent class (Economics) including annualngcost, LCOH and Coam. However, they are not actually redundant because use different units than the parent class, and thus removing their re-declarations in SUTRAEconomics would be a backwards-incompatible change.

@softwareengineerprogrammer softwareengineerprogrammer added the enhancement New feature or request label Jul 25, 2025
UnitType=Units.CURRENCY,
PreferredUnits=CurrencyUnit.MDOLLARS,
CurrentUnits=CurrencyUnit.MDOLLARS,
)
self.Coam = self.OutputParameterDict[self.Coam.Name] = OutputParameter(
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Parent class units are MDOLLARSPERYEAR while SUTRA units are KDOLLARSPERYEAR

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The same applies for self.annualpumpingcosts on line 44 below, which is not commentable in this PR due to technically not being part of the diff.

PreferredUnits=CurrencyUnit.MDOLLARS,
CurrentUnits=CurrencyUnit.MDOLLARS,
)

self.annualngcost = self.OutputParameterDict[self.annualngcost.Name] = OutputParameter(
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Parent class units are MDOLLARSPERYEAR while SUTRA units are KDOLLARSPERYEAR

@@ -347,7 +126,7 @@ def Calculate(self, model: Model) -> None:
# Drilling

self.C1well = 0
if self.ccwellfixed.Valid:
if self.per_production_well_cost.Valid:
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that Economics.ccwellfixed was renamed to per_production_well_cost in ac08741#diff-372dea2554a92733824c98709c9bdb5720c183c31762c3795bd3990f069a2f24R600; thus this change is simply to use the correct variable instead of redefining it redundantly with the old name.

Comment on lines -362 to +141
self.C1well = self.C1well * self.ccwelladjfactor.value
self.C1well = self.C1well * self.production_well_cost_adjustment_factor.value
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that ccwelladjfactor was refactored to injection_well_cost_adjustment_factor in NREL@ac08741 as well

@softwareengineerprogrammer softwareengineerprogrammer merged commit 29122f2 into main Jul 25, 2025
24 checks passed
@softwareengineerprogrammer softwareengineerprogrammer deleted the redundant-class-cleanup branch July 25, 2025 16:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature Request: DH LCOH with peaking boiler cost = 0
1 participant